package com.opages.mvc.demo.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.opages.mvc.demo.model.MvcDemoDto;
import com.opages.mvc.example.model.MvcExampleDto;

/**
 * @author daizhong.liu
 * @create 2020-07-09 19:42
 **/
@FeignClient(name="mvc-demo")
@RequestMapping("/mvc/demo")
public interface MvcDemoApi {
    @GetMapping("/get")
    @ResponseBody
    public MvcDemoDto getDemo(@RequestParam("id")Integer id);

    @PostMapping("/save")
    public void save(MvcDemoDto demoDto);
    /**
     * MVC服务调用MVC服务
     * @Param [id] 主键
     * @return
     **/
    @GetMapping("/getMvcExample")
    public MvcExampleDto getMvcExample(@RequestParam("id")Integer id);
}
